package com.ruoyi.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;

/**
 * 商家优惠券对象 car_coupon
 * 
 * @author ruoyi
 * @date 2025-01-27
 */
@Data
public class CarCoupon
{
    private static final long serialVersionUID = 1L;

    /** 主键id */
    private Integer id;

    /** 商家id */
    @Excel(name = "商家id")
    private Integer mId;

    /** 优惠券名称 */
    @Excel(name = "优惠券名称")
    private String name;

    /** 优惠券类型 */
    @Excel(name = "优惠券类型")
    private String type;

    /** 折扣【如果是打折，则有折扣】 */
    @Excel(name = "折扣")
    private Double discount;

    /** 触发金额【如果是满减，最低金额】 */
    @Excel(name = "触发金额")
    private Double triggerMoney;

    /** 优惠金额【如果是满减，减的金额】 */
    @Excel(name = "优惠金额")
    private Double preferentialMoney;

    /** 开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date start;

    /** 结束时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date end;

    /** 投放数量 */
    @Excel(name = "投放数量")
    private Integer num;

    /** 领取数量 */
    @Excel(name = "领取数量")
    private Integer size;

    /** 优惠券使用开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "优惠券使用开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date expirationStart;

    /** 优惠券过期时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "优惠券过期时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date expirationEnd;

    /** 状态【如果被领完，则不可领取状态】 */
    @Excel(name = "状态")
    private Integer status;

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("mId", getMId())
            .append("name", getName())
            .append("type", getType())
            .append("discount", getDiscount())
            .append("triggerMoney", getTriggerMoney())
            .append("preferentialMoney", getPreferentialMoney())
            .append("start", getStart())
            .append("end", getEnd())
            .append("num", getNum())
            .append("size", getSize())
            .append("expirationStart", getExpirationStart())
            .append("expirationEnd", getExpirationEnd())
            .append("status", getStatus())
            .toString();
    }
}
